Skip to content

Adopt "future" behavior of statement() and frame()#2221

Merged
jacobtylerwalls merged 3 commits intopylint-dev:mainfrom
jacobtylerwalls:future
Jun 22, 2023
Merged

Adopt "future" behavior of statement() and frame()#2221
jacobtylerwalls merged 3 commits intopylint-dev:mainfrom
jacobtylerwalls:future

Conversation

@jacobtylerwalls
Copy link
Member

Type of Changes

Type
🔨 Refactoring

Description

As promised, adopt the "future" behavior of statement() and frame().

Refs #1217

@jacobtylerwalls jacobtylerwalls added the Maintenance Discussion or action around maintaining astroid or the dev workflow label Jun 22, 2023
@jacobtylerwalls jacobtylerwalls added this to the 3.0.0a6 milestone Jun 22, 2023
Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, rest looks good! Thanks for doing this!

@@ -388,23 +388,9 @@ def statement(self, *, future: Literal[True]) -> NoReturn:
def statement(self, *, future: Literal[None, True] = None) -> Module | NoReturn:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def statement(self, *, future: Literal[None, True] = None) -> Module | NoReturn:
def statement(self, *, future: Literal[None, True] = None) -> NoReturn:

self.assertTrue(node._proxied.parent)
self.assertEqual(node._proxied.root().name, value.__class__.__module__)
with self.assertRaises(AttributeError):
with self.assertRaises(StatementMissing):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart re-use of the test!

@jacobtylerwalls jacobtylerwalls merged commit e3ba1ca into pylint-dev:main Jun 22, 2023
@jacobtylerwalls jacobtylerwalls deleted the future branch June 22, 2023 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance Discussion or action around maintaining astroid or the dev workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants